package com.cskaoyan.javase.oop3._1interface._4extend;
/**
 * 抽象类或者接口作为形参数据类型和返回值类型
 * @since 17:34
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        // test(new AbstractA());
        test(new A());
    }

    public static IA getIAInstance(){
        return new IAImpl();
    }

    public static void test(AbstractA a){}
}
interface IA{}
class IAImpl implements IA{}
abstract class AbstractA{}
class A extends AbstractA{}
class Father{
    public IA test(){
        return new IAImpl();
    }
}
class Son extends Father{
    @Override
    public IAImpl test() {
       return new IAImpl();
    }
}